(function(){
   var address = window.location.search;
   var add = address.split("&");
   addzw = decodeURI(add[1]);
   $("#diannao").html(addzw);
   console.log(add);
   $.ajax({
    url:'http://192.168.23.25:3000/api/getproduct'+add[0]+'',
    type:'get',
    datatype:'json',
    success: function(data){
      var name = data.result[0].productName.split(" ")[0];
      console.log(name);
        var html = template("product",data);
        $("#leshi").text(name);
        $("#kanjia").text(data.result[0].productName);
        $("#jingdong").html(html);
    }
   })
   $.ajax({
    url:'http://192.168.23.25:3000/api/getproductcom'+add[0]+'',
    type:'get',
    datatype:'json',
    success: function(data){
      // var name = data.result[0].productName.split(" ")[0];
      // console.log(name);
        var html = template("comment",data);
        // $("#leshi").text(name);
        // $("#kanjia").text(data.result[0].productName);
        $("#yamasun").html(html);
    }
   })
})()
